package com.fxm.controller;

import com.fxm.returns.RespEntity;
import com.fxm.service.VisitService;
import com.fxm.vo.result.VisitResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 访问量统计 前端控制器
 * </p>
 *
 * @author fxm
 * @since 2021-02-04
 */
@RestController
@RequestMapping("/visit")
@Slf4j
@Api(value = "访问量统计", tags = "访问量统计")
public class VisitController {

    @Resource
    private VisitService visitService;

    @GetMapping("/pv")
    @ApiOperation(value = "近24小时和近30日访问量统计")
    public RespEntity<VisitResult> hour() {
        RespEntity<VisitResult> respEntity = visitService.visitList();
        return respEntity;
    }


}
